﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Mathmall.Administration.Migrations
{
    /// <inheritdoc />
    public partial class changeCategoryTableFieldTypeAndLength : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<bool>(
                name: "ShowStatus",
                table: "Category",
                type: "bit",
                nullable: true,
                comment: "是否显示[0-不显示，1显示]",
                oldClrType: typeof(byte),
                oldType: "tinyint",
                oldNullable: true,
                oldComment: "是否显示[0-不显示，1显示]");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Category",
                type: "nvarchar(50)",
                nullable: false,
                defaultValue: "",
                comment: "分类名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldNullable: true,
                oldComment: "分类名称");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<byte>(
                name: "ShowStatus",
                table: "Category",
                type: "tinyint",
                nullable: true,
                comment: "是否显示[0-不显示，1显示]",
                oldClrType: typeof(bool),
                oldType: "bit",
                oldNullable: true,
                oldComment: "是否显示[0-不显示，1显示]");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Category",
                type: "nvarchar(50)",
                nullable: true,
                comment: "分类名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldComment: "分类名称");
        }
    }
}
